﻿using Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IRepository
{
    public interface ISupplierManagementRepository
    {
        /// <summary>
        /// 新增供应商
        /// </summary>
        /// <param name="attachment"></param>
        /// <returns></returns> 
        Task AddAsync(WMSBasicSupplierManagement supplier);

        /// <summary>
        /// 查询所有供应商（支持搜索过滤）
        /// </summary>
        /// <param name="supplierName">供应商名称/编号</param>
        /// <param name="status">状态（启用/禁用）</param>
        /// <param name="industryId">所属行业ID</param>
        /// <param name="managerName">进货负责人名称</param>
        /// <returns>供应商列表DTO</returns>
        Task<List<SupplierListDTO>> GetAllSuppliersAsync(
            string supplierName = null, 
            string status = null,
            int? industryId = null,
            string managerName = null);

        /// <summary>
        /// 根据供应商编号查询详情
        /// </summary>
        /// <param name="supplierCode">供应商编号</param>
        /// <returns>供应商完整信息</returns>
        Task<WMSBasicSupplierManagement> GetSupplierByCodeAsync(string supplierCode);

        /// <summary>
        /// 根据供应商ID查询详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<WMSBasicSupplierManagement> GetSupplierByIdAsync(long supplierId);

        /// <summary>
        /// 供应商编辑
        /// </summary>
        /// <param name="supplier"></param>
        /// <returns></returns>
        Task UpdateAsync(WMSBasicSupplierManagement supplier);

        /// <summary>
        /// 逻辑删除
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        public Task Delete(string supplier_code);

        public Task<List<SupplierListDTO>> GetAllSuppliersAsync();
    }
}
